<script type="text/javascript">
function guidance_open(title,url,w,h){ 
	var index = layer.open({
		type: 2,
		title: title,
		area:["100%","100%"],
		content: url
	});
}

function guidanceinfo_edit(title,url,id,w,h){  /*zosoft-编辑*/
	var index = layer.open({
		type: 2,
		title: title,
		content: url
	});
	layer.full(index);
}

function del(individualId,obj){     /*zosoft-删除*/
	layer.confirm('确认要删除吗？',function(index){
		$.ajax({
			type: 'POST',
			url: '/guidance_service/front/data/individual/logicDelete.do',
			dataType: 'json',
			data:{individualId:individualId},
			success: function(data){
				if(data.data.result){
					$(obj).parents("tr").remove();
					layer.msg('已删除!',{icon:1,time:1000},function(){
					});
				}
			},
			error:function(data) {
				console.log(data.msg,function(){
				});
			},
		});		
	});
}
function update(individualId,individualName,individualCode){
	layer.myprompt(
		{"title": '编辑',
		 "promName":["工程专业","专业编码"],
		 "value":[individualName,individualCode]}, 
		 function(text, index){
			var data ={
				"individualName":text[0].trim(),
				"individualCode":text[1].trim(),
				"individualId":individualId
			}
			$.post("/guidance_service/front/data/individual/update.do",
			       data,
			       function(result){
					if(result.resultCode == 200){
					    layer.close(index);
                        location.replace(location.href);
					}else{
						layer.msg(result.message,{icon:2,time:1000},function(){
							layer.close(index);
							location.replace(location.href);
						});
					}
			});
		});
	
}

function add(objs){
	layer.myprompt(
		{"title": '新增',
		 "promName":["工程专业","专业编码"],
		 "value":[]
		 },
		 function(text, index){
			var data ={
				"individualName":text[0].trim(),
				"individualCode":text[1].trim(),
				"costId":GetQueryString("costId")
			}
			$.post("/guidance_service/front/data/individual/add.do",
			       data,
			       function(result){
					if(result.resultCode == 200){
					    layer.close(index);
					    location.replace(location.href);
					}else{
						layer.msg(result.message,{icon:2,time:1000},function(){
							layer.close(index);
							location.replace(location.href);
						});
					}
			});
		});
	
}
function base_open(url,costId,individualId){ 
	var index = layer.open({
		type: 2,
		title: "编辑",
		area:["100%","100%"],
		content: '/admin/modules/datashare/info/base_info.html?name='+url+'&costId='+costId+"&individualId="+individualId
	});
}
function base_add(url,costId,individualId){ 
	var index = layer.open({
		type: 2,
		title: "新增",
		area:["100%","100%"],
		content: '/admin/modules/datashare/info/base_info.html?name='+url+'&costId='+costId+"&individualId="+individualId
	});
}
</script> 